package main

import (
	"fuck/lexer"
	"fuck/logger"
	"fuck/repl"
	"fuck/token"
	"os"
	"os/user"
)

func main() {
	user, err := user.Current()
	if err != nil {
		panic(err)
	}
	logger.Logf("Hello %s! This is the Fuck programming languauge!\n", user.Username)
	logger.Logln("Feel free to type in commands!")
	repl.Start(os.Stdin, os.Stdout)
}

func file_main() {
	file, err := os.ReadFile("demo.fuck")
	if err != nil {
		return
	}
	str := string(file)
	lexer := lexer.CreateLexer(str)
	for {
		if t := lexer.NextToken(); t.Type != token.EOF {
			logger.Logf("Line %d type %s str \"%s\" \n", t.LineNum, t.Type, t.Literal)
		} else {
			return
		}
	}
}
